# Maintainer: Alexey Minnekhanov <alexeymin@postmarketos.org>
pkgname=libapk-qt
pkgver=0.4.4
pkgrel=0
pkgdesc="Alpine Package Keeper (apk) Qt bindings"
url="https://gitlab.com/postmarketOS/libapk-qt"
# s390x: segfaults in tests
arch="all !s390x"
license="GPL-2.0-only"
makedepends="apk-tools-dev cmake qt5-qtbase-dev samurai"
source="https://gitlab.com/postmarketOS/libapk-qt/-/archive/v$pkgver/libapk-qt-v$pkgver.tar.gz"
subpackages="$pkgname-dev $pkgname-dbg"
builddir="$srcdir/libapk-qt-v$pkgver"
options="!check" # fail with various errors on builders

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_TESTING=ON
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
3a7cd6bda00bc3fae2c0bd29e1554a68b0c32171ca4f9c7ea93123af0753a8ace132c30b3913ca86a619cd63b37369a2135b1e75941544ab555518da06e79479  libapk-qt-v0.4.4.tar.gz
"
